home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / COMM / SERIALDEV / h / example < prev   
Text File  |  1993-01-20  |  962b  |  33 lines

  1. /* Maximum driver length - 4k */
  2. int driver_block[1024];
  3.  
  4. /* The correct driver load prototype so that C doesn't moan */
  5. extern int (*driver_load(char*))(int,...);
  6.  
  7. /*
  8.    Use driver_init() to build driver list - you can use the text
  9.    to build a driver menu if you want. Note that the #defines
  10.    in the driver.h file assume a global int 'portnumber' which
  11.    defines the current port. You could always alter the defines
  12.    accordingly if you want to pass the portnumber yourself.
  13.  
  14.    Load a driver like this:
  15.  
  16.    if ((driver=driver_load("internal"))==NULL)
  17.      {
  18.      error - can't load driver
  19.      }
  20.  
  21.    driver_initialise();
  22.  
  23.    You can call the driver either with the defined methods or
  24.    eg: (*driver)(DRIVER_functioncode,portnumber,data,...)
  25.  
  26.    All the driver functions return in r0, hence are accessible
  27.    by C.
  28.  
  29.    You may want to munge the driver_load, eg to load to malloc'ed
  30.    buffer space or similar - feel free. This is just an example.
  31.  
  32.    */
  33.